<?php
/**
 * 位置--接口
 */

namespace app\frontend\controllers\location;

use App\common\components\BaseController;
use app\frontend\controllers\UserBaseController;

class LocationController extends UserBaseController
{

    public function index()
    {

        $pluginId = request()->input('platform_id', 0);

        $data = [
            'id' => $pluginId
        ];
        return successJson('ok', $data);
    }

    /**
     * 附近取货地点列表
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function nearbyPickupLists()
    {
        //获取数据
        $data = self::getData('Location', 'nearbyPickupLists');
        return successJson('ok', $data);
    }

    /**
     * 我的取货点
     * @return \Illuminate\Http\JsonResponse
     */
    public function   myPickup()
    {
        //获取数据
        $data = self::getData('Location', 'myPickup');
        return successJson('ok', $data);
    }

    /**
     * 取货点城市选择接口
     * @return \Illuminate\Http\JsonResponse
     */
    public function  selectCity()
    {
        //获取数据
        $data = self::getData('Location', 'selectCity');
        return successJson('ok', $data);
    }

    /**
     * 推荐城市
     * @return \Illuminate\Http\JsonResponse
     */
    public function   recommendedCity ()
    {
        //获取数据
        $data = self::getData('Location', 'recommendedCity');
        return successJson('ok', $data);
    }



    /**
     * 选择取货点
     * @return \Illuminate\Http\JsonResponse
     */
    public function   selectLocation ()
    {
        //获取取货点id
        $pickup_id = request()->input('pickup_id', 0);

        //获取数据
        $data = self::getData('Location', 'selectLocation');
        return successJson('ok', $data);
    }

}

